<?php


class View
{
    /**
     * construct
     */
    public function __construct(){}

    /**
     *  view render function
     * 
     *  @param string $name file name
     *  @author cooper <dev.rogozhyn@gmail.com>
     *  @since 02.07.2014
     */
    public function render($name)
    {

        // include header file
        require_once 'views/header.php';

        // render content
        $file = 'views' . DS . $name . '.php' ;
        if(file_exists($file))
        {
            require $file;
        } else {
            require 'controllers/error.php';
            return false;				
        }

        // include footer file
        require_once 'views/footer.php';
    }
}